fin2022=open("D:\\2022_region_out.csv")
map2022={}
for line in fin2022:
    line=line.strip()
    t=line.split(',')
    map2022[t[0]]=float(t[1])
map3={}
fin3=open("D:\\3.csv")
for line in fin3:
    line=line.strip()
    t=line.split(',')
    map3[t[0]]=float(t[1])
for key in map3:
    if key in map2022:
        map3[key]+=map2022[key]
fout1=open("D:\\1.csv","w")
for  key in map3:
    line=str(key)+","+str(map3[key])+"\n"
    fout1.write(line)
fout1.close()

fin2023=open("D:\\2023_region_out.csv")
map2023={}
for line in fin2023:
    line=line.strip()
    t=line.split(',')
    map2023[t[0]]=float(t[1])
map4={}
fin4=open("D:\\3.csv")
for line in fin4:
    line=line.strip()
    t=line.split(',')
    map4[t[0]]=float(t[1])
for key in map4:
    if key in map2023:
        map4[key]+=map2023[key]
fout2=open("D:\\2.csv","w")
for  key in map4:
    line=str(key)+","+str(map4[key])+"\n"
    fout2.write(line)
fout2.close()